﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MuaChung.Models.CouponDetailMin>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ListAllCoupon
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>ListAllCoupon</h2>    

    <%using (Html.BeginForm())
      { %>
      <div id="PagingContent1" class="PagingContent">
            <%string i = ViewData["cp"].ToString();
              string s = ViewData["ps"].ToString(); %>
            <script type="text/javascript">
                GetContent("/Share/Paging?type=adminAllCoupon&currentPage=<%:i %>&pageSize=<%: s %>", "PagingContent1");
            </script>
        </div>
    <input type="hidden" name="currentPage" value="<%: i %>" />
    <input type="hidden" name="orderType" value="<%: ViewData["ot"] %>" />
    <div style="clear:both">
    <table>
        <tr>
            <th></th>                        
            <th>
                Mã Coupon
            </th>
            <th>
                Tên Sản Phẩm
            </th>
            <th>
                Tên Doanh Nghiệp
            </th>                    
            <th>
                Bắt đầu
            </th>
            <th>
                Kết thúc
            </th>            
            <th>
                Giá tốt
            </th>            
            <th>
                Đã đặt
            </th>            
            <th>
                Max
            </th>
            <th>
                Tình trạng
            </th>            
        </tr>

    <% foreach (var item in Model)
       { %>
    
        <tr class="ListTR" id="<%: item.cid %>" onmouseover="javascript:OverOut('<%: item.cid %>',1)" onmouseout="javascript:OverOut('<%: item.cid %>',0)">
            <td><input type="checkbox" name="<%: item.cid%>"/></td>                        
            <td>
                <%: item.maCoupon%>
            </td>
            <td>
                <%: item.tenSP%>
            </td>
            <td>
                <%: item.tenDoanhNghiep%>
            </td>                        
            <td>
                <%: String.Format("{0:g}", item.tgBatDau)%>
            </td>
            <td>
                <%: String.Format("{0:g}", item.tgKetThuc)%>
            </td>            
            <td>
                <%: (int)item.giaTot%>
            </td>            
            <td>
                <%: item.soLuongDatHang%>
            </td>            
            <td>
                <%: item.soLuongMax%>
            </td>
            <td>
                <%: item.trangThai%>
            </td>        
        </tr>
    
    <% } %>

    </table>
    </div>
    <div id="PagingContent2" class="PagingContent" style="clear:both">            
            <script type="text/javascript">
                GetContent("/Share/Paging?type=adminAllCoupon&currentPage=<%:i %>&pageSize=<%: s %>", "PagingContent2");
            </script>
        </div>
    <p>
        <input type=submit name="Update" value="Cập nhật" />
        <input type=submit name="Delete" value="Xóa"/>        
    </p>
    <%} %>
    <p>
        <%: Html.ActionLink("Tạo mới", "CreateCoupon") %>
    </p>
    
</asp:Content>

